<?php
/**
 * This class opens the parent's methods into the public access. 
 * 
 * This class aids in rapid development of classes - especially with
 * transient variables.  This mixin allows developers to set key-value 
 * property pairs at runtime, similar to JavaScript or ActionScript classes.  As
 * a result, developers can treat transient data as properties, and keep more
 * meaningful data as instance variables.
 * 
 * The predominant design goal in this mixin is to implement a solution
 * which allows developers to collect secondary object data into a single
 * collection.  Consequently, this secondary data becomes accessible through
 * a common access scheme (getters and setters).  Object data variables which
 * have more meaning, processing, or influence would still be considered
 * traditional instance variables.
 * 
 */
class ClassStructure_Mixin_Property extends ClassStructure_Property {
	
	/**
	 * Constructor: sets object properties during object construction
	 * 
	 * @access public
	 * @param mixed $mix_properties An array or object of properties.
	 * @return object
	 */
	public function __construct($mix_properties = array()) {
		parent::__construct($mix_properties);
	}
    
	public function setProperties($arr_properties = array()) {
		parent::setProperties($arr_properties);
	}
		
	/**
	 * Assigns a specific property, and can enforce overwriting values
	 * 
	 * @access protected
	 * @param string $str_key A valid property key.
	 * @param mixed $mix_value A value to store associated with the key.
	 * @param boolean $bln_overwrite Whether to overwrite an existing property.
	 * @return void
	 */
	public function setProperty($str_key, $mix_value, $bln_overwrite = true) {
		parent::setProperty($str_key, $mix_value, $bln_overwrite);
	}
    
	/**
	 * Returns a collection of key-value property pairs
	 * 
	 * Both parameters are not necessary, though the second parameter does allow
	 * users to extract all keys from the particular namespace.  The first 
	 * parameter defines a string needle to extract similar keys. 
	 * 
	 * For example, the properties may have a common prefix such as 'display_'.
	 * To extract all properties that have this keyword, but exclude all others,
	 * the method call would be:
	 * 
	 * $object->get_properties('display_');
	 * 
	 * @access public
	 * @param string $str_needle Defines a search needle to extract keys.
	 * @return array
	 */
	public function getProperties() {
		return parent::getProperties();
	}
    
    public function getPropertiesMatching($str_needle) {
        return parent::getPropertiesMatching($str_needle);
    }
		
	/**
	 * Retrieves a specific property from the collection
	 * 
	 * @access public
	 * @param string $str_key A valid property key.
	 * @param mixed $mix_return Whether to return a particular value if property is
	 * 		not found, or an exception.
	 * @return mixed
	 */
	public function getProperty($str_key, $mix_return = self::RETURN_EXCEPTION) {
		return parent::getProperty($str_key, $mix_return);
	}
		
	/**
	 * Determines if a specific property key exists within the collection
	 * 
	 * @access public
	 * @param string $str_key An property key to test existence.
	 * @return boolean
	 */
	public function issetProperty($str_key) {
		return parent::issetProperty($str_key);
	}
    
    /**
     * Unsets a specific property key and destroys its value
     * 
     * @access protected
     * @param string $str_key An property key to test existence.
	 * @return void
     */
    public function unsetProperty($str_key) {
		return parent::unsetProperty($str_key);
	}
    
    public function clearProperties() {
        parent::clearProperties();
    }
		
}
?>
